<template>
  <div>
    <div class="layout1">
      <Menu mode="horizontal" thme="dark" active-name="1" class="layout1-header">
        <div class="layout1-logo"></div>
        <div class="layout1-nav">
          <Menu-item name="1">
            <Icon type="ios-navigate"></Icon> 导航1
          </Menu-item>
          <Menu-item name="2">
            <Icon type="ios-navigate"></Icon> 导航2
          </Menu-item>
          <Menu-item name="3">
            <Icon type="ios-navigate"></Icon> 导航3
          </Menu-item>
          <Menu-item name="4">
            <Icon type="ios-navigate"></Icon> 导航4
          </Menu-item>
        </div>
      </Menu>

      <div class="layout1-breadcrumb">
        <Breadcrumb>
          <Breadcrumb-item href="">Home</Breadcrumb-item>
          <Breadcrumb-item href="#">Application center</Breadcrumb-item>
          <Breadcrumb-item>Other Application</Breadcrumb-item>
        </Breadcrumb>
      </div>

      <div class="layout1-content">Content Area</div>

      <div class="layout1-copy">2011-2016 Talking Data</div>
    </div>

    <div class="layout2">
      <Row type="flex">
        <Col :span="spanLeft" class="layout2-menu-left">
          <Menu active-name="1" width="auto">
            <div class="layout2-logo-left"></div>
            <Menu-item name="1">
              <Icon type="ios-navigate"></Icon> 导航1
            </Menu-item>
            <Menu-item name="2">
              <Icon type="ios-navigate"></Icon> 导航2
            </Menu-item>
            <Menu-item name="3">
              <Icon type="ios-navigate"></Icon> 导航3
            </Menu-item>
          </Menu>
        </Col>

        <Col :span="spanRight">
          <div class="layout2-header">
            <i-button type="text" @click="toggleShowHide">
              <Icon type="navicon" size="32"></Icon>
            </i-button>
          </div>

          <div class="layout2-breadcrumb">
            <Breadcrumb>
              <Breadcrumb-item href="">Home</Breadcrumb-item>
              <Breadcrumb-item href="">Application</Breadcrumb-item>
              <Breadcrumb-item>Other Application</Breadcrumb-item>
            </Breadcrumb>
          </div>

          <div class="layout2-content">Layout2 content</div>

          <div class="layout2-copy">
            2011-2016 Talking Data
          </div>
        </Col>
      </Row>
    </div>

    <div class="layout3">
      <Row type="flex">
        <Col span="5" class="layout3-menu-left">
          <Menu active-name="1-2" width="auto">
            <div class="layout3-logo-left"></div>
            <Submenu name="1">
              <template slot="title">
                <Icon type="ios-navigate"></Icon> nav 1
              </template>
              <Menu-item name="1-1">option 1</Menu-item>
              <Menu-item name="1-2">option 2</Menu-item>
              <Menu-item name="1-3">option 3</Menu-item>
            </Submenu>
            <Submenu name="2">
              <template slot="title">
                <Icon type="ios-navigate"></Icon> nav 2
              </template>
              <Menu-item name="2-1">option 1</Menu-item>
              <Menu-item name="2-2">option 2</Menu-item>
              <Menu-item name="2-3">option 3</Menu-item>
            </Submenu>
            <Submenu name="3">
              <template slot="title">
                <Icon type="ios-navigate"></Icon> nav 3
              </template>
              <Menu-item name="3-1">option 1</Menu-item>
              <Menu-item name="3-2">option 2</Menu-item>
              <Menu-item name="3-3">option 3</Menu-item>
            </Submenu>
          </Menu>
        </Col>
      </Row>
    </div>
  </div>
</template>

<script>
	export default {
		data () {
			return {
        spanLeft: 5,
        spanRight: 19
      }
    },
    methods: {
      toggleShowHide () {
        if(this.spanLeft === 5) {
          this.spanLeft = 2;
          this.spanRight = 22;
        } else {
          this.spanLeft = 5;
          this.spanRight = 19;
        }
      }
    }
  }
</script>

<style>
  .layout2,
  .layout1 {
    background-color: #fafafa;
    margin-bottom: 50px;
    display: none;
  }
  .layout2-header,
  .layout1-header {
    background-color: #3a3a3a;
  }
  .layout1-logo {
    width: 120px;
    height: 30px;
    margin: 15px 40px;
    float: left;
    background-color: #5b6270;
  }
  .layout1-nav {
    width: 600px;
    float: left;
    margin: 0 auto;
  }
  .layout1-breadcrumb,
  .layout2-breadcrumb {
    margin-top: 5px;
    padding: 5px;
  }
  .ivu-breadcrumb span {
    text-align: left;
  }
  .layout2-content,
  .layout1-content {
    background-color: #fff;
    min-height: 500px;
  }
  .layout2-copy,
  .layout1-copy {
    padding: 15px 0;
    text-align: center;
  }
  .ivu-col{
    transition: width .2s ease-in-out;
  }
</style>
